package com.vt.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vt.admin.api.dto.SysRoleListDto;
import com.vt.admin.api.dto.SysMenuTreeDto;
import com.vt.admin.api.entity.SysRole;
import com.vt.admin.api.entity.SysRoleMenu;
import com.vt.admin.api.param.RoleMenuPermission;
import com.vt.admin.api.param.SysRoleListParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {
    Page<SysRoleListDto> list(SysRoleListParam param);

    List<SysMenuTreeDto> getMenuPermission(@Param("roleId") String roleId,@Param("userId") String userId);

    void deleteUserRole(@Param("roleId") String id);

    void deleteRoleMenu(@Param("roleId") String id);

    void deleteMenuPermission(RoleMenuPermission param);

    void batchInsertMenuPermission(List<SysRoleMenu> list);

    List<SysRole> findRoleByCompanyId(@Param("managerId") String managerId);
}
